package com.guava;

import com.google.common.base.Predicate;
import com.google.common.collect.Collections2;
import com.google.common.collect.Lists;

import java.util.Collection;
import java.util.List;

/**
 * FilterList--GuavaTest
 *
 * @author: Jovi
 * @createTime: 2018-07-10 15:02
 **/
public class FilterList {

    public static void main(String[] args) {
        List<Integer> names = Lists.newArrayList(5, 6, 7, 8, 9, 0, 10);
        Collection<Integer> result = Collections2.filter(names, new Predicate<Integer>() {
            @Override
            public boolean apply(Integer integer) {
                return integer > 9;
            }
        });
        System.out.println(result.size());
    }
}
